<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <!-- xml: -->
    <!-- 自定义标签，存储数据 -->
    <!-- <student>
        <age>100</age>
        <name>老邓</name>
    </student> -->

    <div></div>
    <div></div>
    <script type="text/javascript">

        // 只能通过HTML间接修改样式
        var div = document.getElementsByTagName('div');
        // 生成一个类数组，dom对象
        div[0].style.width = "100px";
        div[0].style.height = "100px";
        div[0].style.backgroundColor = "red";
        // 连字符用小驼峰表示
    
        var count = 0;
        div[0].onclick = function() {
            if(count % 2 == 0){//三种颜色就模三
                this.style.backgroundColor = '#008c8c';
                this.style.borderRadius = "50%";
            }else{
                this.style.backgroundColor = "red";
                this.style.borderRadius = '0px';
            }
            count ++;
        }
    
    </script>
</body>
</html>